package main

import (
	"gin-project-01/gin-step02/gin09-model/models"
	routers2 "gin-project-01/gin-step02/gin09-model/routers"
	"github.com/gin-gonic/gin"
	"html/template"
)

// main
//
//	@Description: Gin框架中自定义Model
func main() {
	r := gin.Default()

	//设置自定义模板函数
	r.SetFuncMap(template.FuncMap{
		"UnixToTime": models.UnixToTime, //注册模板函数
		"GetDouble":  models.GetDouble,  //注册模板函数
	})
	r.LoadHTMLGlob("templates/**/*")
	r.Static("/static", "./static")
	//配置路由
	routers2.IndexRouters(r)
	routers2.UserRouters(r)
	r.Run(":8888")

}
